package com.example.demo;

public class AdaoterDemo {
    public static void main(String[] args) {
        A a=AFactory.createInstance();
        a.hai("1");
    }

    public static class AB extends A{
        private B b=new B();
        public String hai(String i){
            return b.hai(Integer.valueOf(i));
        }
    }

    public static class A{
        public String hai(String name){
            return name;
        }


    }
    public static class B{
        public String hai(int i){
            return String.valueOf(i);
        }
    }

    private static class AFactory {


        public static A createInstance() {
            return new A();
        }
    }
}
